import { ServiceProto } from 'tsrpc-proto'
import { ReqGetConfigList, ResGetConfigList } from './PtlGetConfigList'
import { ReqGetConfigs, ResGetConfigs } from './PtlGetConfigs'
import { ReqSaveConfigs, ResSaveConfigs } from './PtlSaveConfigs'
import { ReqValidateConfigs, ResValidateConfigs } from './PtlValidateConfigs'
import { ReqGetConfigStats, ResGetConfigStats } from './PtlGetConfigStats'
import { ReqImportConfigs, ResImportConfigs } from './PtlImportConfigs'
import { ReqExportConfigs, ResExportConfigs } from './PtlExportConfigs'
import { ReqGetConfigSchemas, ResGetConfigSchemas } from './PtlGetConfigSchemas'

export interface ServiceType {
    api: {
        'config-editor/GetConfigList': {
            req: ReqGetConfigList,
            res: ResGetConfigList
        },
        'config-editor/GetConfigs': {
            req: ReqGetConfigs,
            res: ResGetConfigs
        },
        'config-editor/SaveConfigs': {
            req: ReqSaveConfigs,
            res: ResSaveConfigs
        },
        'config-editor/ValidateConfigs': {
            req: ReqValidateConfigs,
            res: ResValidateConfigs
        },
        'config-editor/GetConfigStats': {
            req: ReqGetConfigStats,
            res: ResGetConfigStats
        },
        'config-editor/ImportConfigs': {
            req: ReqImportConfigs,
            res: ResImportConfigs
        },
        'config-editor/ExportConfigs': {
            req: ReqExportConfigs,
            res: ResExportConfigs
        },
        'config-editor/GetConfigSchemas': {
            req: ReqGetConfigSchemas,
            res: ResGetConfigSchemas
        }
    },
    msg: {

    }
}

export const serviceProto: ServiceProto<ServiceType> = {
    "version": 1,
    "services": [
        {
            "id": 0,
            "name": "config-editor/GetConfigList",
            "type": "api"
        },
        {
            "id": 1,
            "name": "config-editor/GetConfigs",
            "type": "api"
        },
        {
            "id": 2,
            "name": "config-editor/SaveConfigs",
            "type": "api"
        },
        {
            "id": 3,
            "name": "config-editor/ValidateConfigs",
            "type": "api"
        },
        {
            "id": 4,
            "name": "config-editor/GetConfigStats",
            "type": "api"
        },
        {
            "id": 5,
            "name": "config-editor/ImportConfigs",
            "type": "api"
        },
        {
            "id": 6,
            "name": "config-editor/ExportConfigs",
            "type": "api"
        },
        {
            "id": 7,
            "name": "config-editor/GetConfigSchemas",
            "type": "api"
        }
    ],
    "types": {}
}
